<%--
  Created by IntelliJ IDEA.
  User: pc
  Date: 2021/1/3
  Time: 21:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%pageContext.setAttribute("APP_PATH", request.getContextPath());%>
<%pageContext.setAttribute("IMG_PATH", request.getContextPath().concat("/plugins/images/article/"));%>
<div>
    <c:if test="${pageInfo.list.size() > 0}">
        <c:if test="${pageInfo.pageNum < pageInfo.pages}">
            <input id="pageNum" type="hidden" value="${pageInfo.pageNum}">
        </c:if>
        <c:forEach var="article" items="${pageInfo.list}">
            <c:if test="${article.status==1}">
                <div class="top-20 clearfix">
                    <div class="wid-70 pull-left">
                        <a href="${APP_PATH.concat("/article/detail?id=").concat(article.fid)}"><h4>${article.titles}</h4></a>
                        <p>${fn:substring(article.fcontent, 0, 100)}</p>
                        <a href="${APP_PATH.concat("/user/user-info?id=").concat(article.userid)}">
                            <small>
            <span class="glyphicon glyphicon-user" aria-hidden="true">
                    ${article.username}
            </span>
                            </small>
                        </a>
                        <span style="margin: 0 10px;"></span>
                        <a href="javascript:void(0);">
                            <small>
            <span class="glyphicon glyphicon-map-marker" aria-hidden="true">
            </span>${article.bname}
                            </small>
                        </a>
                    </div>
                    <div class="wid-30 pull-right">
                        <a href="#">
                            <img class="article-pic" src="${IMG_PATH.concat(article.photo)}" alt="picture">
                        </a>
                    </div>
                </div>
                <hr>
            </c:if>
        </c:forEach>
    </c:if>
    <c:if test="${pageInfo.list.size() <= 0 && pageInfo.pageNum < pageInfo.pages}">
        <input id="pageNum" type="hidden" value="1">
    </c:if>
</div>